package org.swimv2.entities;

import java.io.Serializable;
import javax.persistence.*;

import java.util.Date;


/**
 * The persistent class for the friendship_request database table.
 * 
 * @author Gaibotti Adriano
 * @author Lorenzo Delledonne
 */
@NamedQueries({
	@NamedQuery(
		name="FriendshipRequest.getById",
		query="SELECT f FROM FriendshipRequest AS f WHERE f.id = :id")
})
@Entity
@Table(name="friendship_request")
public class FriendshipRequest implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@GeneratedValue(strategy=GenerationType.AUTO)
	private int id;

    @Temporal( TemporalType.TIMESTAMP)
	private Date date;

	//uni-directional many-to-one association to User
    @ManyToOne
	private User sender;

	//uni-directional many-to-one association to User
    @ManyToOne
	private User receiver;
    
    //constructor
    public FriendshipRequest() {
    }
    
    ////////////////////////
    // getters and setters//
    ////////////////////////
    
	public int getId() {
		return this.id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public Date getDate() {
		return this.date;
	}

	public void setDate(Date date) {
		this.date = date;
	}

	public User getSender() {
		return this.sender;
	}

	public void setSender(User sender) {
		this.sender = sender;
	}
	
	public User getReceiver() {
		return this.receiver;
	}

	public void setReceiver(User receiver) {
		this.receiver = receiver;
	}
	
}